<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>执业药师题库</title>
    <meta name="description" content="A Collection of Page Transitions with CSS Animations" />
    <meta name="keywords" content="page transition, css animation, website, effect, css3, jquery" />
    <meta name="author" content="Chauncey" />
    <link rel="stylesheet" type="text/css" href="css/component.css" />
    <link rel="stylesheet" type="text/css" href="css/animations.css" />

    <link rel="stylesheet" type="text/css" href="css/base.css">
    <style>
        html,
        body {
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Lato', Calibri, Arial, sans-serif;
            color: #fff;
            background: #333;
            overflow: hidden;
        }

        .lists {
            /* background-color: red; */
            width: 100%;
            height: 55%;
            margin-top: 42%;
        }
    </style>
</head>

<body class="no-js">

    <div class="pt-triggers" style="display: block;">
        <button id="iterateEffects" class="pt-touch-button">章节练习</button>
    </div>

    <div id="pt-main" class="pt-perspective">
        <div class="pt-page pt-page-1">
            <h2>距离考试时间还剩下<span style="color: red;"></span>天</h2>
            <h1><span><(￣︶￣)↗[GO!]</span>执业药师刷题</h1>
            <div class="grid__item theme-2">
                <button class="action"><svg class="icon icon--rewind">
                        <use xlink:href="#icon-rewind"></use>
                    </svg></button>
                <div class="particles">
                    <div class="particles-wrapper"><button id="particles-button1" class="particles-button">随机50题<span
                                class="count1"></span></button></div><canvas class="particles-canvas"
                        style="display: none;"></canvas>
                </div>
            </div>
            <div class="grid__item theme-9">
                <button class="action"><svg class="icon icon--rewind">
                        <use xlink:href="#icon-rewind"></use>
                    </svg></button>
                <div class="particles">
                    <div class="particles-wrapper"><button id="particles-button2" class="particles-button">错误本<span
                                class="count2"></span></button></div><canvas class="particles-canvas"
                        style="display: none;"></canvas>
                </div>
            </div>

        </div>
        <div class="pt-page pt-page-2">
            <h1><span>(ง •_•)ง[加油!]</span>章节练习</h1>
            <div class="lists">
                <IFRAME NAME="content_frame" width=100% height=100% SRC="list.html"></IFRAME>
            </div>
        </div>
    </div>

    <!-- 页面切换 -->
    <script src="./js/jquery.min.js"></script>
    <script src="js/transition.js"></script>

    <!-- 按钮 -->
    <script src="js/anime.min.js"></script>
    <script src="js/particles.js"></script>
    <script src="js/demo.js"></script>

    <script src="js/url.js"></script>

    <script>
        var translate = new transition({
            $main: $('#pt-main'),
            loop: true,
            callback: function (index) {
                // console.log(index);
                if (index == 1) {

                }
            }
        });

        var x = 1;
        $('#iterateEffects').click(function () {
            if (x < 2) {
                x++;
                $('.pt-touch-button').text("返回首页")
            } else {
                x = 1;
                $('.pt-touch-button').text("章节练习")
            }
            translate.nextPage(x);
        });

        $('#particles-button1').click(function () {
            setTimeout(function () {
                window.location.href = "/answer/answer/index.html?data=" + "RandTopics/50";
            }, 1000);
        })

        //错题个数
        var errorCount= 0;
        $('#particles-button2').click(function () {
            setTimeout(function () {
                if (errorCount == 0) {
                    alert("没有错题可做")
                    location.reload(true) 
                }else{
                    window.location.href = "/answer/answer/index.html?data=" + "wrongtopic";
                }
            }, 1000);
        })

    </script>
    <script>
        // 定义两个日期
        var date2 = new Date('2023-10-21');
        // 计算日期差异（以毫秒为单位）
        var diff = date2.getTime() - new Date().getTime();
        // 将毫秒转换为天数
        var days = parseInt(diff / (1000 * 60 * 60 * 24));
        // 输出结果
        // console.log(days);
        $("h2 span").text(days)
    </script>
    <script>
        $.get($.url+"/yj/answer/homepage", {}, function (data) {
            $(".count1").text("(" + data.data.count1 + ")")
            errorCount = data.data.count2;
            $(".count2").text("(" + data.data.count2 + ")")
        })
    </script>
</body>

</html>